package cate.common.table.chat;

import cate.common.table.ESheet;
import easy.java.dev.note.NoteClass;

@NoteClass(value = "聊天频道等级")
public class ChatChannelLevelSheet extends ESheet<ChatChannelLevelRow> {

    @Override
    public String getSheetName() {
        return "聊天频道等级";
    }

    public int getLevelByChannel(int channel, int openDay) {
        // 修正开服时间
        if (openDay <= 0) {
            openDay = 1;
        }
        int level = 0;
        for (ChatChannelLevelRow row : this.getList()) {
            if (row.channel == channel && openDay >= row.openDay) {
                if (row.level > level) {
                    level = row.level;
                }
            }
        }
        return level;
    }
}
